package com.gnerv.oauth.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore;

import javax.annotation.Resource;
import javax.sql.DataSource;

@Configuration
public class AccessTokenConfig {

    @Resource
    private DataSource dataSource;

    @Bean
    TokenStore tokenStore(){
        return new JdbcTokenStore(dataSource);
    }

}
